package  
{
	import treasures.*;
	
	/**
	 * ...
	 * @author JAC
	 */
	public class Tracker 
	{
		public static var wave:int;
		public static var maxWave:int;
		public static var mapScore:int;
		public static var score:int;
		public static var minScore:int;
		public static var lives:int;
		public static var enemiesDefeated:int;
		public static var enemiesEscaped:int;
		public static var itemsUsed:int;
		public static var itemsPickedUp:int;
		public static var interactionsUsed:int;
		public static var levelComplete:Boolean;

		public static function init():void
		{
			wave = 1;
			maxWave = 1;
			mapScore = 0;
			score = 0;
			minScore = 0;
			lives = 0;
			enemiesDefeated = 0;
			enemiesEscaped = 0;
			itemsUsed = 0;
			itemsPickedUp = 0;
			interactionsUsed = 0;
			levelComplete = false;
		}
		
		public static function tallyTreasures():void
		{
			var s:int = 0;
			for (var i:uint = 0; i < Registry.treasures.length; i++)
			{
				var t:Treasure = Registry.treasures.members[i];
				s += t._size;
			}
			score = s;
		}
		
		public static function traceTracker():void
		{
			trace("MapScore: " + mapScore);
			trace("Score: " + score);
			trace("MinScore: " + minScore);
			trace("Lives: " + lives);
			trace("Wave: " + wave);
			trace("Enemies Defeated: " + enemiesDefeated);
			trace("Enemies Escaped: " + enemiesEscaped);
			trace("Items Used: " + itemsUsed);
			trace("Items Picked Up: " + itemsPickedUp);
			trace("Interactions Used: " + interactionsUsed);
			trace("Level complete: " + levelComplete);
		}
		
		public static function log(lg:LevelGrave):Array
		{
			var data:Array = new Array();
			data.push(lg.prettyName);
			data.push(score);
			data.push(lives);
			data.push(wave);
			data.push(enemiesDefeated);
			data.push(enemiesEscaped);
			data.push(itemsUsed);
			data.push(itemsPickedUp);
			data.push(interactionsUsed);
			data.push(levelComplete.toString());
			data.push(Registry.heatMap.data);
			
			return data;
		}
	}
}